﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;

namespace CourseArraging.Frm.jcxx
{
    /// <summary>
    /// 版权所有
    /// 石世特@温州医学院 sst330381@gmail.com
    /// </summary> 
    public class FrmInfoCourse : FrmInfoBase
    {
        private Button button1;

        // Events
        public event refreshlist reflist;

        // Methods
        public FrmInfoCourse()
        {
            this.components = null;
            this.InitializeComponent();
        }

        public FrmInfoCourse(int id, string content)
            : base(id, content)
        {
            this.components = null;
            this.InitializeComponent();
            this.Text = "课程信息";
        }

        public override bool be4save()
        {
            return true;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(285, 170);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 99;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            // 
            // FrmInfoCourse
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.ClientSize = new System.Drawing.Size(360, 193);
            this.Controls.Add(this.button1);
            this.Name = "FrmInfoCourse";
            this.Text = "FrmInfoCourse";
            this.Controls.SetChildIndex(this.button1, 0);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        public override void tsb_save_fun()
        {
            if (string.IsNullOrEmpty(base.label_id.Text))
            {
                base.basicdao.addCourseInfo(base.txt_content.Text);
                MessageBox.Show("添加成功 !");
            }
            else
            {
                base.basicdao.updateCourseinfo(int.Parse(base.label_id.Text), base.txt_content.Text);
                MessageBox.Show("修改成功 !");
            }
            base.Close();
            this.reflist();
        }

        // Nested Types
        public delegate void refreshlist();
    }

 

}
